package com.ruoyi.system.outto.goods.impl;

import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.GlobalException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.V2.gameAttr.mapper.GameAttributeMapper;
import com.ruoyi.system.V2.inter.mapper.ArtRecMapper;
import com.ruoyi.system.model.domain.ArtRec;
import com.ruoyi.system.model.domain.GameAttribute;
import com.ruoyi.system.model.domain.SalePartner;
import com.ruoyi.system.model.dto.GoodsInfoAndAttrValueDto;
import com.ruoyi.system.outto.core.MapUntils;
import com.ruoyi.system.outto.goods.HOUPANGXIEApi;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.*;

/**
 * @author lz
 * @version 1.0
 * @date 2022/6/20 14:07
 */
@Slf4j
@Service
public class HOUPANGXIEApiImpl implements HOUPANGXIEApi {
    static String imgUrl = "";
    @Resource
    private GameAttributeMapper gameAttributeMapper;
    @Resource
    private ArtRecMapper artRecMapper;
    public static void main(String[] args) {

        Random random = new Random();
        // 生成四位随机数
        int randomNum = random.nextInt(9000) + 1000;
        System.out.println(randomNum);
    }

    static String getOssConfig(SalePartner salePartner) {
        String token = getToken(salePartner);
        String url = "http://api-merchant.pxb7.com/business/getOssConfig";
        String response = HttpRequest.get(url).header("Authorization", token).execute().body();
        return response;
    }

    static String getAttrs(Integer game_id, SalePartner salePartner) {
        String token = getToken(salePartner);
        Map<String, Object> params = new HashMap<>();
        params.put("game_id", game_id);
        String url = "http://api-merchant.pxb7.com/business/product/getaddscreen";
        String response = HttpRequest.post(url).header("Authorization", token).body(JSONObject.toJSONString(params)).execute().body();
        return response;
    }

    public static String add() {
        Map<String, Object> params = new HashMap<>();
        params.put("game_id", 13);
        params.put("unique_no_shangjia", "14552");
        params.put("id_api", "14552");
        params.put("image", "https://img.zhanghaoguai.com/2c9180848bd1136c018bdb21ab720af4.png");
        params.put("is_shenhe", "1");
        params.put("condition", "1");
        params.put("name", "王者荣耀");
        params.put("price", "1000");
        params.put("pro_type", "1");
        params.put("qq_buy", "");
        params.put("skin_num", "1");
        List<Object> attr = new ArrayList<>();
        Map<String, Object> map = new HashMap<>();
        map.put("cat_id", "1");
        List<Object> attList = new ArrayList<>();
        attList.add("1");
        map.put("id", attList);
        attr.add(map);
        params.put("attr", attr);
        String content = "<p><img src=\\\"https:\\/\\/img.gpzzh.com\\/2c9280838880526901889eb138a5061e\\\"><h3>yd333590_安卓Q V8 英雄:114 皮肤:160 贵族积分:55570 典藏:2 五级铭文:261 王者印记:2 紫晶:154 幸运值:110 账号详情:全息碎影 武则天 至尊宝 凤求凰 冰锋战神 启明星使 云霓雀翎 辉光之辰 虞姬霸王别姬 逐梦之影 孙尚香末日机甲 黄金射手座 圣诞狂欢 永曜之星 心灵战警 逐梦之星 紫霞仙子 魔术师 皇家上将 海洋之心 地狱火 功夫厨神 金属风暴 高山流水 游园惊梦 鹰眼护卫 梁祝 水果甜心 暗隐猎兽者 遇见飞天 偶像歌手 冰冠公主 鬼剑武藏 千年之狐 水晶猎龙者 乘风破浪 魅力维加斯 潮玩探月行 无双福将 野性能量 特工战影 秘密基地 瓷语鉴心 丁香结 次元突破 霸王丸 五福同心 守护之力 汉昭烈帝 鲨炮海盗猫 黄金武士 爱心护理 虹云星官 幻乐之宴 科学大爆炸 坚韧之力 美猴王 如懿 敏锐之力 掌控之力 功夫老勺 制霸全明星 幻想奇妙夜 万事如意 街头霸王 致命风华 化身博士 海滩丽影 红桃皇后 龙腾万里 阴阳师 白执事 海滩派对 鲤鱼之梦 教廷特使 进击墨子号 纽约教父 少女阿狸 死亡骑士 狄仁杰超时空战士 神迹守卫钟馗 朔望之晖 蓝屏警告 海盐诗旅 大漠名商 金庭之子 沙漠行僧 千军破阵 演武夺筹 万华元夜 原初探秘者 醍醐杖 疑决卦 混沌棋 朔风刀 御銮 御旌 御霄 御狮 穷奇 重明 烛龙 饕餮 无畏之灵·狰 凯尔特女王 炼金王 妖精王 营地ID: <\\/h3><img src=https:\\/\\/img.gpzzh.com\\/2c9280838880526901889eb138c1061f \\/><img src=https:\\/\\/img.gpzzh.com\\/2c9280838880526901889eb182560623 \\/><img src=https:\\/\\/img.gpzzh.com\\/2c9280838880526901889eb181530620 \\/><img src=https:\\/\\/img.gpzzh.com\\/2c9280838880526901889eb181710621 \\/><img src=https:\\/\\/img.gpzzh.com\\/2c9280838880526901889eb182540622 \\/><img src=https:\\/\\/img.gpzzh.com\\/2c9280838880526901889eb183310624 \\/>";
        params.put("content", content);

        String url = "http://api-merchant.pxb7.com/business/product/add";
        log.info(JSONObject.toJSONString(params));
        String authorization = HttpRequest.post(url).header("Authorization", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJQWEI3LUJVU0lORVNTLkFQSSIsImV4cCI6MTcwMjU4MDczMCwiYXVkIjoiYWRtaW4iLCJuYmYiOjE3MDI1Mzc1MzAsImlhdCI6MTcwMjUzNzUzMCwidXNlciI6eyJ1c2VyX2lkIjoxMDAsInVzZXJfbmFtZSI6Ilx1NzlkZlx1NmUzOFx1NGU1MCIsIm51bWJlciI6Inp5bCIsImNvbnRhY3QiOiJcdTc5ZGZcdTZlMzhcdTRlNTAiLCJxcSI6Ijg4ODg4ODg4IiwidGVsZXBob25lIjoiMTg2MDAwMDAwMDAiLCJ3eCI6IjE4NjAwMDAwMDAwIiwiZ2FtZUlkcyI6WyIxMyIsIjI2IiwiMjMiLCIxMSIsIjQwIiwiMzIiLCIzMyIsIjEyIl19fQ.JdWDRIOiofz4e9IRsYcEXDIQqdUQpHuZCOvmA-AnfyA").body(JSONObject.toJSONString(params)).execute().body();
        log.info(authorization);
        return authorization;
    }
//    public void sleep(){
//        Random random = new Random();
//
//        // 设置最小和最大休眠时间（单位为毫秒）
//        int minTime = 10000; // 最小休眠时间为10秒
//        int maxTime = 15000; // 最大休眠时间为15秒
//
//        // 计算随机休眠时间并转换为long型
//        long sleepTime = (random.nextInt((maxTime - minTime) + 1)) + minTime;
//        try {
//            Thread.sleep(sleepTime);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
//    }

    @Override
    public AjaxResult addGame(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, SalePartner salePartner) {
//        sleep();
        String token = getToken(salePartner);
        Map<String, Object> params = params(goodsInfoAndAttrValueDto, "add", salePartner);
        log.info("螃蟹添加接口请求参数={}", JSONObject.toJSONString(params));
        String url = "http://api-merchant.pxb7.com/business/product/add";
        log.info(JSONObject.toJSONString(params));
        String response = HttpRequest.post(url).header("Authorization", token).body(JSONObject.toJSONString(params)).execute().body();
        log.info("螃蟹添加接口返回参数={}", response);
        JSONObject resultJson = JSONObject.parseObject(response);

        Map<String, Object> result = new HashMap<>();
        if (!"200".equals(resultJson.getString("code"))) {
            result.put("code", 500);
        } else {
            result.put("code", 200);
            String data = resultJson.getString("data");
            String id = JSONObject.parseObject(data).getString("id");
            result.put("outId", id);
        }
        result.put("req", JSONObject.toJSONString(params));
        result.put("res", response);
        result.put("msg", resultJson.toJSONString());
        return AjaxResult.success(result);

    }

    @Override
    public AjaxResult editGame(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto,
                               SalePartner salePartner) {
        String url = "http://api-merchant.pxb7.com/business/product/editPrice";
        String token = getToken(salePartner);
        Map<String, Object> params = new HashMap<>();
        Integer game_id = 0;
        if (goodsInfoAndAttrValueDto.getGameName().contains("王者荣耀")) {
            game_id = 13;
        } else if (goodsInfoAndAttrValueDto.getGameName().contains("和平精英")) {
            game_id = 11;
        } else if (goodsInfoAndAttrValueDto.getGameName().equals("英雄联盟")) {
            game_id = 12;
        } else if (goodsInfoAndAttrValueDto.getGameName().contains("原神")) {
            game_id = 26;
        } else if (goodsInfoAndAttrValueDto.getGameName().contains("穿越火线")) {
            game_id = 39;
        } else if (goodsInfoAndAttrValueDto.getGameName().contains("枪战王者")) {
            game_id = 33;
        } else if (goodsInfoAndAttrValueDto.getGameName().contains("蛋仔派对")) {
            game_id = 142;
        } else if (goodsInfoAndAttrValueDto.getGameName().contains("火影忍者")) {
            game_id = 32;
        } else if (goodsInfoAndAttrValueDto.getGameName().contains("地下城与勇士")) {
            game_id = 25;
        } else if (goodsInfoAndAttrValueDto.getGameName().equals("英雄联盟(手游)")) {
            game_id = 36;
        } else if (goodsInfoAndAttrValueDto.getGameName().contains("永劫无间")) {
            game_id = 23;
        } else if (goodsInfoAndAttrValueDto.getGameName().contains("无畏契约")) {
            game_id = 148;
        }


        params.put("game_id", game_id);
        if (goodsInfoAndAttrValueDto.getGameName().equals("枪战王者")) {
            params.put("unique_no_merchant", goodsInfoAndAttrValueDto.getId());
        } else if (goodsInfoAndAttrValueDto.getGameName().equals("英雄联盟")) {
            params.put("unique_no_merchant", goodsInfoAndAttrValueDto.getId());
        } else {
            params.put("game_account", goodsInfoAndAttrValueDto.getAccountNumber());
        }
        String url1 = "http://api-merchant.pxb7.com/business/product/plist";
        String authorization = HttpRequest.post(url1).header("Authorization", token).body(JSONObject.toJSONString(params)).execute().body();
        JSONObject resultJson = JSONObject.parseObject(authorization);
        String string = resultJson.getJSONObject("data").getString("list");

        boolean flag = false;
        String response = "";
        if (StringUtils.isNotEmpty(string)) {
            if (CollectionUtils.isNotEmpty(JSONObject.parseArray(string))) {
                Object o = null;
                o = JSONArray.parseArray(string).get(0);

                String id = JSONObject.parseObject(o.toString()).getString("id");
                params.put("game_id", game_id);
                params.put("id", id);
                params.put("price", Math.ceil(goodsInfoAndAttrValueDto.getPrice().doubleValue()));
                log.info("螃蟹改价接口请求参数={}", JSONObject.toJSONString(params));
                log.info(JSONObject.toJSONString(params));
                response = HttpRequest.post(url).header("Authorization", token).body(JSONObject.toJSONString(params)).execute().body();
                log.info("螃蟹改价接口返回参数={}", response);
                resultJson = JSONObject.parseObject(response);
            } else {
                flag = true;
            }
        } else {
            flag = true;
        }
        if (flag) {
            throw new GlobalException("当前账号未上架!!!" + goodsInfoAndAttrValueDto.getAccountNumber());
        }

        Map<String, Object> result = new HashMap<>();
        if (!"200".equals(resultJson.getString("code"))) {
            result.put("code", 500);
        } else {
            result.put("code", 200);
        }
        result.put("req", JSONObject.toJSONString(params));
        result.put("res", response);
        result.put("msg", resultJson.toJSONString());
        return AjaxResult.success(result);
    }

    @Override
    public AjaxResult delGame(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, SalePartner salePartner) {

        ArtRec artRecreq = new ArtRec();
        artRecreq.setConfig(salePartner.getId());
        artRecreq.setAccountId(goodsInfoAndAttrValueDto.getId());
        List<ArtRec> artRecs = artRecMapper.selectArtRecList(artRecreq);
        if (CollectionUtils.isNotEmpty(artRecs)) {
            goodsInfoAndAttrValueDto.setOutId(artRecs.get(0).getOutid());
        } else {
            throw new GlobalException("没有三方ID!!!");
        }

        String token = getToken(salePartner);
        if (null != goodsInfoAndAttrValueDto) {
            Map<String, Object> params = new HashMap<>();
            Integer game_id = 0;
            if (goodsInfoAndAttrValueDto.getGameName().contains("王者荣耀")) {
                game_id = 13;
            } else if (goodsInfoAndAttrValueDto.getGameName().contains("和平精英")) {
                game_id = 11;
            } else if (goodsInfoAndAttrValueDto.getGameName().equals("英雄联盟")) {
                game_id = 12;
            } else if (goodsInfoAndAttrValueDto.getGameName().contains("原神")) {
                game_id = 26;
            } else if (goodsInfoAndAttrValueDto.getGameName().contains("穿越火线")) {
                game_id = 39;
            } else if (goodsInfoAndAttrValueDto.getGameName().contains("枪战王者")) {
                game_id = 33;
            } else if (goodsInfoAndAttrValueDto.getGameName().contains("蛋仔派对")) {
                game_id = 142;
            } else if (goodsInfoAndAttrValueDto.getGameName().contains("火影忍者")) {
                game_id = 32;
            } else if (goodsInfoAndAttrValueDto.getGameName().contains("地下城与勇士")) {
                game_id = 25;
            } else if (goodsInfoAndAttrValueDto.getGameName().equals("英雄联盟(手游)")) {
                game_id = 36;
            } else if (goodsInfoAndAttrValueDto.getGameName().contains("永劫无间")) {
                game_id = 23;
            } else if (goodsInfoAndAttrValueDto.getGameName().contains("无畏契约")) {
                game_id = 148;
            }

            String string = "";
            params.put("game_id", game_id);
            params.put("unique_no_merchant", goodsInfoAndAttrValueDto.getId());
            String url = "http://api-merchant.pxb7.com/business/product/plist";
            String authorization = HttpRequest.post(url).header("Authorization", token).body(JSONObject.toJSONString(params)).execute().body();
            JSONObject resultJson = JSONObject.parseObject(authorization);
            string = resultJson.getJSONObject("data").getString("list");
            String responses = "";
            String message = "";
            if (StringUtils.isNotEmpty(string)) {
                if (CollectionUtils.isNotEmpty(JSONObject.parseArray(string))) {

                    Object o = JSONArray.parseArray(string).get(0);
                    String id = JSONObject.parseObject(o.toString()).getString("id");
                    log.info(id);
                    //先下架
                    Map<String, Object> delparams = new HashMap<>();
                    delparams.put("game_id", game_id);
                    delparams.put("id", id);
                    delparams.put("field", "is_shangjia");
                    delparams.put("field_val", 0);
                    String delurl = "http://api-merchant.pxb7.com/business/product/status";
                    responses = HttpRequest.post(delurl).header("Authorization", token).body(JSONObject.toJSONString(delparams)).execute().body();

                    delparams = new HashMap<>();
                    delparams.put("game_id", game_id);
                    delparams.put("id", id);
                    delurl = "http://api-merchant.pxb7.com/business/product/delete";
                    responses = HttpRequest.post(delurl).header("Authorization", token).body(JSONObject.toJSONString(delparams)).execute().body();
                    log.info("螃蟹删除接口请求参数={}", JSONObject.toJSONString(params));
                    log.info("螃蟹删除接口返回参数={}", responses);
                    resultJson = JSONObject.parseObject(responses);
                    message = resultJson.getString("message");
                    message = MapUntils.unicodeToString(message);
                }
            }
            Map<String, Object> result = new HashMap<>();
            if (!"200".equals(resultJson.getString("code"))) {
                result.put("code", 500);
            } else {
                result.put("code", 200);
                if (CollectionUtils.isNotEmpty(artRecs)) {
                    artRecMapper.deleteArtRecById(artRecs.get(0).getId());
                }
            }
            result.put("req", JSONObject.toJSONString(params));
            result.put("res", responses);
            result.put("msg", message);
            return AjaxResult.success(result);
        } else {
            throw new GlobalException("删除ID未查询到此数据");
        }
    }

    static String getToken(SalePartner salePartner) {
        String url1 = "http://api-merchant.pxb7.com/business/login";
        Map<String, String> params1 = new HashMap<>();
        params1.put("user_name", salePartner.getSaleKey());
        params1.put("password", salePartner.getOther());
        String response = com.ruoyi.system.outto.dto.yx7881.utils.HttpUtil.doPost(url1, params1);
        JSONObject jsonObject = JSONObject.parseObject(response);
        if ("200".equals(jsonObject.getString("code"))) {
            String data = jsonObject.getString("data");
            JSONObject jsonObject1 = jsonObject.parseObject(data);
            log.info("token={}", jsonObject1.getString("token"));
            return jsonObject1.getString("token");
        }
        return null;
    }

    private Map<String, Object> params(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto, String type, SalePartner sa) {
        Map<String, Object> params = new HashMap<>();
        params.put("user_id", sa.getTwoOther());
        params.put("unique_no_shangjia", goodsInfoAndAttrValueDto.getThirdId());
        params.put("image", goodsInfoAndAttrValueDto.getTitleImg());
//        params.put("is_shenhe", "1");
        params.put("condition", "1");
        params.put("price", Math.ceil(goodsInfoAndAttrValueDto.getPrice().doubleValue()));
        params.put("pro_type", "1");
        List<Object> attr = new ArrayList<>();
        Map<String, Object> map = new HashMap<>();
        List<Object> attList = new ArrayList<>();
        params.put("name", goodsInfoAndAttrValueDto.getTitle());
        if (goodsInfoAndAttrValueDto.getGameName().equals("王者荣耀")) {
            params.put("game_id", 13);
            String response = getAttrs(13, sa);
            String data = JSONObject.parseObject(response).getString("data");
            JSONArray jsonArray = JSONArray.parseArray(data);
            for (Object o : jsonArray) {
                map = new HashMap<>();
                attList = new ArrayList<>();
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("按系统")) {
                    String regional = goodsInfoAndAttrValueDto.getSystemName() + goodsInfoAndAttrValueDto.getCarrierName();
                    String string = JSONObject.parseObject(o.toString()).getString("attr");
                    JSONArray jsonArray1 = JSONArray.parseArray(string);
                    for (Object p : jsonArray1) {
                        if (JSONObject.parseObject(p.toString()).getString("name").equals(regional)) {
                            attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            break;
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("荣耀典藏")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF9())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF9());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (gameAttribute.getFieldName().replace("-", "").contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("内测皮肤")) {
                    String pfIds = "";
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF11());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF15());
                    List<GameAttribute> gameAttributs = getGameAttributs(pfIds);
                    String string = JSONObject.parseObject(o.toString()).getString("attr");
                    JSONArray jsonArray1 = JSONArray.parseArray(string);
                    for (GameAttribute gameAttribute : gameAttributs) {
                        for (Object p : jsonArray1) {
                            if (gameAttribute.getFieldName().replace("-", "").contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("实名情况")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF16())) {
                        GameAttribute gameAttribute = gameAttributeMapper.selectGameAttributeById(Long.valueOf(goodsInfoAndAttrValueDto.getF16()));
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (Object p : jsonArray1) {
                            if (gameAttribute.getFieldName().replace("包人脸", "支持人脸包赔").replace("已删实名", "不可二次实名").contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                break;
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("有无防沉迷")) {
                    attList.add("203");
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("星元皮肤")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF10())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF10());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (gameAttribute.getFieldName().replace("-", "").replace("·", "").contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("年限皮肤")) {
                    String pfIds = "";
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF9());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF10());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF11());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF12());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF15());
                    List<GameAttribute> gameAttributs = getGameAttributs(pfIds);
                    String string = JSONObject.parseObject(o.toString()).getString("attr");
                    JSONArray jsonArray1 = JSONArray.parseArray(string);
                    for (GameAttribute gameAttribute : gameAttributs) {
                        for (Object p : jsonArray1) {
                            if (gameAttribute.getFieldName().replace("-", "").replace("·", "").contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("大国标")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF18())) {
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (Object p : jsonArray1) {
                            if (JSONObject.parseObject(p.toString()).getString("name").contains(goodsInfoAndAttrValueDto.getF18())) {
                                attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("小国标")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF18())) {
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (Object p : jsonArray1) {
                            if (JSONObject.parseObject(p.toString()).getString("name").contains(goodsInfoAndAttrValueDto.getF18())) {
                                attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("赛季限定")) {
                    String pfIds = "";
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF9());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF10());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF11());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF12());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF15());
                    List<GameAttribute> gameAttributs = getGameAttributs(pfIds);
                    String string = JSONObject.parseObject(o.toString()).getString("attr");
                    JSONArray jsonArray1 = JSONArray.parseArray(string);
                    for (GameAttribute gameAttribute : gameAttributs) {
                        for (Object p : jsonArray1) {
                            if (gameAttribute.getFieldName().replace("-", "").replace("·", "").contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("战令限定")) {
                    String pfIds = "";
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF9());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF10());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF11());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF12());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF15());
                    List<GameAttribute> gameAttributs = getGameAttributs(pfIds);
                    String string = JSONObject.parseObject(o.toString()).getString("attr");
                    JSONArray jsonArray1 = JSONArray.parseArray(string);
                    for (GameAttribute gameAttribute : gameAttributs) {
                        for (Object p : jsonArray1) {
                            if (gameAttribute.getFieldName().replace("-", "").replace("·", "").contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("史诗皮肤")) {
                    String pfIds = "";
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF9());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF10());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF11());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF12());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF15());
                    List<GameAttribute> gameAttributs = getGameAttributs(pfIds);
                    String string = JSONObject.parseObject(o.toString()).getString("attr");
                    JSONArray jsonArray1 = JSONArray.parseArray(string);
                    for (GameAttribute gameAttribute : gameAttributs) {
                        for (Object p : jsonArray1) {
                            if (gameAttribute.getFieldName().replace("-", "").replace("·", "").contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("史诗皮肤")) {
                    String pfIds = "";
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF9());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF10());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF11());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF12());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF15());
                    List<GameAttribute> gameAttributs = getGameAttributs(pfIds);
                    String string = JSONObject.parseObject(o.toString()).getString("attr");
                    JSONArray jsonArray1 = JSONArray.parseArray(string);
                    for (GameAttribute gameAttribute : gameAttributs) {
                        for (Object p : jsonArray1) {
                            if (gameAttribute.getFieldName().replace("-", "").replace("·", "").contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("限定皮肤")) {
                    String pfIds = "";
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF9());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF10());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF11());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF12());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF15());
                    List<GameAttribute> gameAttributs = getGameAttributs(pfIds);
                    String string = JSONObject.parseObject(o.toString()).getString("attr");
                    JSONArray jsonArray1 = JSONArray.parseArray(string);
                    for (GameAttribute gameAttribute : gameAttributs) {
                        for (Object p : jsonArray1) {
                            if (gameAttribute.getFieldName().replace("-", "").replace("·", "").contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("传说皮肤")) {
                    String pfIds = "";
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF9());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF10());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF11());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF12());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF15());
                    List<GameAttribute> gameAttributs = getGameAttributs(pfIds);
                    String string = JSONObject.parseObject(o.toString()).getString("attr");
                    JSONArray jsonArray1 = JSONArray.parseArray(string);
                    for (GameAttribute gameAttribute : gameAttributs) {
                        for (Object p : jsonArray1) {
                            if (gameAttribute.getFieldName().replace("-", "").replace("·", "").contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("其他皮肤")) {
                    String pfIds = "";
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF9());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF10());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF11());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF12());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF15());
                    List<GameAttribute> gameAttributs = getGameAttributs(pfIds);
                    String string = JSONObject.parseObject(o.toString()).getString("attr");
                    JSONArray jsonArray1 = JSONArray.parseArray(string);
                    for (GameAttribute gameAttribute : gameAttributs) {
                        for (Object p : jsonArray1) {
                            if (gameAttribute.getFieldName().replace("-", "").replace("·", "").contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            }
                        }
                    }
                }
                if (CollectionUtils.isNotEmpty(attList)) {
                    map.put("cat_id", JSONObject.parseObject(o.toString()).getString("cat_id"));
                    map.put("id", attList);
                    attr.add(map);
                }
            }
            params.put("skin_num", StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF8()) ? goodsInfoAndAttrValueDto.getF8() : "0");
        } else if (goodsInfoAndAttrValueDto.getGameName().equals("和平精英")) {
            params.put("game_id", 11);
            String response = getAttrs(11, sa);
            String data = JSONObject.parseObject(response).getString("data");
            JSONArray jsonArray = JSONArray.parseArray(data);
            for (Object o : jsonArray) {
                map = new HashMap<>();
                attList = new ArrayList<>();
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("按大区")) {
                    String regional = goodsInfoAndAttrValueDto.getSystemName() + goodsInfoAndAttrValueDto.getCarrierName();
                    String string = JSONObject.parseObject(o.toString()).getString("attr");
                    JSONArray jsonArray1 = JSONArray.parseArray(string);
                    for (Object p : jsonArray1) {
                        if (JSONObject.parseObject(p.toString()).getString("name").equals(regional)) {
                            attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            break;
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("优质套装")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF5())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF5());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (JSONObject.parseObject(p.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("稀有飞行器")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF3())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF3());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (JSONObject.parseObject(p.toString()).getString("name").contains(gameAttribute.getFieldName().replace("飞行服", "飞行器").replace("飞行翼", "飞行器"))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("优质枪皮肤")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF1())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF1());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (JSONObject.parseObject(p.toString()).getString("name").replace("-", "").contains(gameAttribute.getFieldName().replace("-", ""))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("稀有载具")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF2())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF2());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            String fieldName = gameAttribute.getFieldName();
                            if (fieldName.equals("阿斯顿马丁S红色")) {
                                fieldName = "阿斯顿马丁DBS（红）";
                            } else if (fieldName.equals("阿斯顿马丁S绿色")) {
                                fieldName = "阿斯顿马丁DBS（绿）";
                            } else if (fieldName.equals("玛莎拉蒂M白色")) {
                                fieldName = "玛莎拉蒂MC20（星石白）";
                            } else if (fieldName.equals("玛莎拉蒂Grecale(幻星粉)")) {
                                fieldName = "玛莎拉蒂Grecale（幻星粉）";
                            } else if (fieldName.equals("阿斯顿马丁X金色")) {
                                fieldName = "阿斯顿马丁DBX（金）";
                            } else if (fieldName.equals("阿斯顿马丁X蓝色")) {
                                fieldName = "阿斯顿马丁DBX（蓝）";
                            } else if (fieldName.equals("合金龙骨红色")) {
                                fieldName = "合金龙骨（红）";
                            } else if (fieldName.equals("合金龙骨蓝色")) {
                                fieldName = "合金龙骨（蓝）";
                            } else if (fieldName.equals("合金龙骨绿色")) {
                                fieldName = "合金龙骨（绿）";
                            } else if (fieldName.equals("空客恋语之翼僚机")) {
                                fieldName = "空客H135恋语之翼";
                            } else if (fieldName.equals("空客蔚蓝之翼僚机")) {
                                fieldName = "空客H135蔚蓝之翼";
                            } else if (fieldName.equals("塞莎鲸之蓝")) {
                                fieldName = "快艇塞莎KL27（鲸之蓝）";
                            } else if (fieldName.equals("塞莎深潜蓝")) {
                                fieldName = "快艇塞莎KL27（深潜蓝）";
                            } else if (fieldName.equals("塞莎霓虹粉")) {
                                fieldName = "快艇塞莎KL27（霓虹粉）";
                            } else if (fieldName.equals("自由的鲸")) {
                                fieldName = "快艇自由的鲸";
                            } else if (fieldName.equals("兰博SVJ绿色")) {
                                fieldName = "兰博基尼Aventador SVJ（翡翠绿）";
                            } else if (fieldName.equals("兰博SVJ尊享铂")) {
                                fieldName = "兰博基尼Aventador SVJ（尊享铂）";
                            } else if (fieldName.equals("兰博轿车金色")) {
                                fieldName = "兰博基尼Estoque（炫光金）";
                            } else if (fieldName.equals("兰博轿车灰色")) {
                                fieldName = "兰博基尼Estoque（银翼灰）";
                            } else if (fieldName.equals("兰博轿车尊享铂")) {
                                fieldName = "兰博基尼Estoque（尊享铂）";
                            } else if (fieldName.equals("兰博SUV黄色")) {
                                fieldName = "兰博基尼URUS（明艳黄）";
                            } else if (fieldName.equals("兰博SUV金色")) {
                                fieldName = "兰博基尼URUS（炫光金）";
                            } else if (fieldName.equals("兰博SUV尊享铂")) {
                                fieldName = "兰博基尼URUS（尊享铂）";
                            } else if (fieldName.equals("路特斯EL蓝色")) {
                                fieldName = "路特斯ELETRE（冰川蓝）";
                            } else if (fieldName.equals("路特斯EL紫色")) {
                                fieldName = "路特斯ELETRE（电光紫）";
                            } else if (fieldName.equals("路特斯EL灰色")) {
                                fieldName = "路特斯ELETRE（花绽灰）";
                            } else if (fieldName.equals("路特斯EV紫色")) {
                                fieldName = "路特斯EVIJA（电光紫）";
                            } else if (fieldName.equals("路特斯EV黄色")) {
                                fieldName = "路特斯EVIJA（星际黄）";
                            } else if (fieldName.equals("玛莎拉蒂粉色")) {
                                fieldName = "玛莎拉蒂Ghibli（粉）";
                            } else if (fieldName.equals("玛莎拉蒂金色")) {
                                fieldName = "玛莎拉蒂Ghibli（金）";
                            } else if (fieldName.equals("玛莎拉蒂蓝色")) {
                                fieldName = "玛莎拉蒂Ghibli（蓝）";
                            } else if (fieldName.equals("玛莎拉蒂G绿色")) {
                                fieldName = "玛莎拉蒂Grecale（薄荷绿）";
                            } else if (fieldName.equals("玛莎拉蒂MC20(幻星粉)")) {
                                fieldName = "玛莎拉蒂MC20（幻星粉）";
                            } else if (fieldName.equals("玛莎拉蒂Quattroporte(幻星粉)")) {
                                fieldName = "玛莎拉蒂Quattroporte（幻星粉）";
                            } else if (fieldName.equals("玛莎拉蒂Q蓝色")) {
                                fieldName = "玛莎拉蒂Quattroporte（夜幕蓝）";
                            } else if (fieldName.equals("萌兔起飞僚机")) {
                                fieldName = "萌兔起飞";
                            } else if (fieldName.equals("南瓜车")) {
                                fieldName = "南瓜骑士车";
                            } else if (fieldName.equals("双刃魅影红色")) {
                                fieldName = "双人摩托双刃魅影（红）";
                            } else if (fieldName.equals("双刃魅影金色")) {
                                fieldName = "双人摩托双刃魅影（金）";
                            } else if (fieldName.equals("双刃魅影绿色")) {
                                fieldName = "双人摩托双刃魅影（绿）";
                            } else if (fieldName.equals("特斯拉C荒芜蓝")) {
                                fieldName = "特斯拉Cybertruck（荒芜蓝）";
                            } else if (fieldName.equals("阿斯顿马丁X橙色")) {
                                fieldName = "阿斯顿马丁DBX（橙）";
                            } else if (fieldName.equals("特斯拉C极昼黑")) {
                                fieldName = "特斯拉Cybertruck（极昼黑）";
                            } else if (fieldName.equals("特斯拉C镭光铂")) {
                                fieldName = "特斯拉Cybertruck（镭光铂）";
                            } else if (fieldName.equals("特斯拉3银色")) {
                                fieldName = "特斯拉Model3（冷光银）";
                            } else if (fieldName.equals("特斯拉3紫色")) {
                                fieldName = "特斯拉Model3（奇幻紫）";
                            } else if (fieldName.equals("特斯拉3白色")) {
                                fieldName = "特斯拉Model3（珍珠白）";
                            } else if (fieldName.equals("特斯拉X银色")) {
                                fieldName = "特斯拉ModelX（冷光银）";
                            } else if (fieldName.equals("特斯拉X紫色")) {
                                fieldName = "特斯拉ModelX（奇幻紫）";
                            } else if (fieldName.equals("特斯拉X白色")) {
                                fieldName = "特斯拉ModelX（珍珠白）";
                            } else if (fieldName.equals("特斯拉R沁心粉")) {
                                fieldName = "特斯拉Roadster（沁心粉）";
                            } else if (fieldName.equals("特斯拉R水滴蓝")) {
                                fieldName = "特斯拉Roadster（水滴蓝）";
                            } else if (fieldName.equals("特斯拉R尊享铂")) {
                                fieldName = "特斯拉Roadster（尊享铂）";
                            }
                            for (Object p : jsonArray1) {
                                if (JSONObject.parseObject(p.toString()).getString("name").contains(fieldName)) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("实名情况")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF10())) {
                        GameAttribute gameAttribute1 = gameAttributeMapper.selectGameAttributeById(Long.valueOf(goodsInfoAndAttrValueDto.getF10()));
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (Object p : jsonArray1) {
                            if (JSONObject.parseObject(p.toString()).getString("name").equals(gameAttribute1.getFieldName().replace("包人脸", "支持人脸包赔").replace("已删实名", "不可二次实名"))) {
                                attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                break;
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("有无防沉迷")) {
                    attList.add("208");
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("王牌印记")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF16())) {
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (Object p : jsonArray1) {
                            if (JSONObject.parseObject(p.toString()).getString("name").contains(goodsInfoAndAttrValueDto.getF16())) {
                                attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                break;
                            }
                        }
                    } else {
                        attList.add("422");
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("稀有套装")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF5())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF5());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (JSONObject.parseObject(p.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (CollectionUtils.isNotEmpty(attList)) {
                    map.put("cat_id", JSONObject.parseObject(o.toString()).getString("cat_id"));
                    map.put("id", attList);
                    attr.add(map);
                }
            }
        } else if (goodsInfoAndAttrValueDto.getGameName().equals("英雄联盟")) {
            params.put("game_id", 12);
            String response = getAttrs(12, sa);
            String data = JSONObject.parseObject(response).getString("data");
            JSONArray jsonArray = JSONArray.parseArray(data);
            for (Object o : jsonArray) {
                map = new HashMap<>();
                attList = new ArrayList<>();
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("按大区")) {
                    String regional = goodsInfoAndAttrValueDto.getGroupName();
                    String string = JSONObject.parseObject(o.toString()).getString("attr");
                    JSONArray jsonArray1 = JSONArray.parseArray(string);
                    for (Object p : jsonArray1) {
                        if (JSONObject.parseObject(p.toString()).getString("name").equals(regional)) {
                            attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            break;
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("按服务器")) {
                    String regional = goodsInfoAndAttrValueDto.getServerName();
                    String string = JSONObject.parseObject(o.toString()).getString("attr");
                    JSONArray jsonArray1 = JSONArray.parseArray(string);
                    for (Object p : jsonArray1) {
                        if (JSONObject.parseObject(p.toString()).getString("name").equals(regional)) {
                            attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            break;
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("至臻皮肤")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF8())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF8());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (onlyHanZi(JSONObject.parseObject(p.toString()).getString("name")).contains(onlyHanZi(gameAttribute.getFieldName()))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("海克斯皮肤")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF9())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF9());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (onlyHanZi(JSONObject.parseObject(p.toString()).getString("name")).contains(onlyHanZi(gameAttribute.getFieldName()))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("限定皮肤")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF7())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF7());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (onlyHanZi(JSONObject.parseObject(p.toString()).getString("name")).contains(gameAttribute.getFieldName())) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("年限皮肤")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF10())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF10());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (onlyHanZi(JSONObject.parseObject(p.toString()).getString("name")).contains(gameAttribute.getFieldName())) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("情人节限定")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF12())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF12());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (onlyHanZi(JSONObject.parseObject(p.toString()).getString("name")).contains(gameAttribute.getFieldName())) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("冰雪限定")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF13())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF13());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (onlyHanZi(JSONObject.parseObject(p.toString()).getString("name")).contains(gameAttribute.getFieldName())) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("单双排段位")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF2())) {
                        GameAttribute gameAttribute1 = gameAttributeMapper.selectGameAttributeById(Long.valueOf(goodsInfoAndAttrValueDto.getF2()));
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (Object p : jsonArray1) {
                            if (onlyHanZi(JSONObject.parseObject(p.toString()).getString("name")).contains(gameAttribute1.getFieldName())) {
                                attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                break;
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("实名情况")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF1())) {
                        GameAttribute gameAttribute1 = gameAttributeMapper.selectGameAttributeById(Long.valueOf(goodsInfoAndAttrValueDto.getF1()));
                        if (gameAttribute1.getFieldName().equals("有修改人脸机会/实名是本人")) {
                            attList.add("320");
                        } else if (gameAttribute1.getFieldName().equals("无修改人脸机会/实名是本人")) {
                            attList.add("321");
                        } else {
                            attList.add("319");
                        }
                    } else {
                        attList.add("320");
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("终极皮肤")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF17())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF17());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (JSONObject.parseObject(p.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (CollectionUtils.isNotEmpty(attList)) {
                    map.put("cat_id", JSONObject.parseObject(o.toString()).getString("cat_id"));
                    map.put("id", attList);
                    attr.add(map);
                }
            }
        } else if (goodsInfoAndAttrValueDto.getGameName().equals("原神")) {
            params.put("game_id", 26);
            String response = getAttrs(26, sa);
            String data = JSONObject.parseObject(response).getString("data");
            JSONArray jsonArray = JSONArray.parseArray(data);
            for (Object o : jsonArray) {
                map = new HashMap<>();
                attList = new ArrayList<>();
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("按邮箱")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF2())) {
                        GameAttribute gameAttribute1 = gameAttributeMapper.selectGameAttributeById(Long.valueOf(goodsInfoAndAttrValueDto.getF2()));
                        if (gameAttribute1.getFieldName().equals("未绑定邮箱")) {
                            attList.add("250");
                        } else if (gameAttribute1.getFieldName().equals("普通Q邮(随游戏出售)")) {
                            attList.add("656");
                        } else if (gameAttribute1.getFieldName().equals("字母Q邮")) {
                            attList.add("657");
                        } else if (gameAttribute1.getFieldName().equals("不送邮箱/死邮")) {
                            attList.add("2");
                        } else if (gameAttribute1.getFieldName().contains("未实名")) {
                            attList.add("1");
                        } else if (gameAttribute1.getFieldName().contains("已实名")) {
                            attList.add("1");
                        }
                    } else {
                        attList.add("250");
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("邮箱实名")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF2())) {
                        GameAttribute gameAttribute1 = gameAttributeMapper.selectGameAttributeById(Long.valueOf(goodsInfoAndAttrValueDto.getF2()));
                        if (gameAttribute1.getFieldName().equals("未绑定邮箱")) {
                            attList.add("252");
                        } else if (gameAttribute1.getFieldName().equals("普通Q邮(随游戏出售)")) {
                            attList.add("658");
                        } else if (gameAttribute1.getFieldName().equals("字母Q邮")) {
                            attList.add("660");
                        } else if (gameAttribute1.getFieldName().equals("不送邮箱/死邮")) {
                            attList.add("251");
                        } else if (gameAttribute1.getFieldName().contains("未实名")) {
                            attList.add("249");
                        } else if (gameAttribute1.getFieldName().contains("已实名")) {
                            attList.add("248");
                        }
                    } else {
                        attList.add("252");
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("按角色")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF11())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF11());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (gameAttribute.getFieldName().contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("按武器")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF17())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF17());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (gameAttribute.getFieldName().contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("按价格")) {
                    if (goodsInfoAndAttrValueDto.getPrice().intValue() < 200) {
                        attList.add("19");
                    } else if (goodsInfoAndAttrValueDto.getPrice().intValue() >= 200 && goodsInfoAndAttrValueDto.getPrice().intValue() <= 1000) {
                        attList.add("20");
                    } else if (goodsInfoAndAttrValueDto.getPrice().intValue() >= 1001 && goodsInfoAndAttrValueDto.getPrice().intValue() <= 5000) {
                        attList.add("21");
                    } else if (goodsInfoAndAttrValueDto.getPrice().intValue() >= 5001 && goodsInfoAndAttrValueDto.getPrice().intValue() <= 10000) {
                        attList.add("22");
                    } else {
                        attList.add("23");
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("按区服")) {
                    if (goodsInfoAndAttrValueDto.getGroupName().equals("米哈游官服")) {
                        attList.add("134");
                    } else if (goodsInfoAndAttrValueDto.getGroupName().equals("米哈游官服")) {
                        attList.add("133");
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("按服务器")) {
                    attList.add("654");
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("按主角")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF3())) {
                        GameAttribute gameAttribute1 = gameAttributeMapper.selectGameAttributeById(Long.valueOf(goodsInfoAndAttrValueDto.getF3()));
                        if (gameAttribute1.getFieldName().equals("男主")) {
                            attList.add("229");
                        } else {
                            attList.add("230");
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("武器精炼")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF17())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF17());
                        String child = JSONObject.parseObject(o.toString()).getString("_child");
                        JSONArray jsonArray2 = JSONArray.parseArray(child);
                        for (Object p : jsonArray2) {
                            map = new HashMap<>();
                            attList = new ArrayList<>();
                            String string = JSONObject.parseObject(p.toString()).getString("attr");
                            JSONArray jsonArray1 = JSONArray.parseArray(string);
                            for (GameAttribute gameAttribute : gameAttributs) {
                                for (Object q : jsonArray1) {
                                    if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                        attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                    }
                                }
                            }
                            if (CollectionUtils.isNotEmpty(attList)) {
                                map.put("cat_id", JSONObject.parseObject(p.toString()).getString("cat_id"));
                                map.put("id", attList);
                                attr.add(map);
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("角色命座")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF11())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF11());
                        String child = JSONObject.parseObject(o.toString()).getString("_child");
                        JSONArray jsonArray2 = JSONArray.parseArray(child);
                        for (Object p : jsonArray2) {
                            map = new HashMap<>();
                            attList = new ArrayList<>();
                            String string = JSONObject.parseObject(p.toString()).getString("attr");
                            JSONArray jsonArray1 = JSONArray.parseArray(string);
                            for (GameAttribute gameAttribute : gameAttributs) {
                                for (Object q : jsonArray1) {
                                    if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                        attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                    }
                                }
                            }
                            if (CollectionUtils.isNotEmpty(attList)) {
                                map.put("cat_id", JSONObject.parseObject(p.toString()).getString("cat_id"));
                                map.put("id", attList);
                                attr.add(map);
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("可向买家提供实名改密信息")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF20())) {
                        GameAttribute gameAttribute1 = gameAttributeMapper.selectGameAttributeById(Long.valueOf(goodsInfoAndAttrValueDto.getF20()));
                        if (gameAttribute1.getFieldName().equals("有修改人脸机会/实名是本人")) {
                            attList.add("714");
                        } else {
                            attList.add("715");
                        }
                    }
                }
                if (CollectionUtils.isNotEmpty(attList) && !JSONObject.parseObject(o.toString()).getString("cat_name").equals("武器精炼") && !JSONObject.parseObject(o.toString()).getString("cat_name").equals("角色命座")) {
                    map.put("cat_id", JSONObject.parseObject(o.toString()).getString("cat_id"));
                    map.put("id", attList);
                    attr.add(map);
                }
            }
        } else if (goodsInfoAndAttrValueDto.getGameName().equals("地下城与勇士端游")) {
            params.put("game_id", 25);
        } else if (goodsInfoAndAttrValueDto.getGameName().equals("枪战王者")) {
            params.put("game_id", 33);
            String response = getAttrs(33, sa);
            String data = JSONObject.parseObject(response).getString("data");
            JSONArray jsonArray = JSONArray.parseArray(data);
            for (Object o : jsonArray) {
                map = new HashMap<>();
                attList = new ArrayList<>();
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("操作系统")) {
                    String regional = goodsInfoAndAttrValueDto.getSystemName() + goodsInfoAndAttrValueDto.getCarrierName();
                    String string = JSONObject.parseObject(o.toString()).getString("attr");
                    JSONArray jsonArray1 = JSONArray.parseArray(string);
                    for (Object p : jsonArray1) {
                        if (JSONObject.parseObject(p.toString()).getString("name").equals(regional)) {
                            attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            break;
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("按价格")) {
                    Integer regional = goodsInfoAndAttrValueDto.getPrice().intValue();
                    if (regional >= 500 && regional <= 4999) {
                        attList.add("19");
                    } else if (regional >= 5000 && regional <= 9999) {
                        attList.add("20");
                    } else if (regional >= 10000 && regional <= 14999) {
                        attList.add("21");
                    } else if (regional >= 15000 && regional <= 19999) {
                        attList.add("22");
                    } else if (regional > 20000) {
                        attList.add("23");
                    } else {
                        attList.add("19");
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("至尊系列")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF12())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF12());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (gameAttribute.getFieldName().replace("王者幻神至尊套", "王者神幻至尊套").contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("实名情况")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF10())) {
                        GameAttribute gameAttribute1 = gameAttributeMapper.selectGameAttributeById(Long.valueOf(goodsInfoAndAttrValueDto.getF10()));
                        if (gameAttribute1.getFieldName().contains("有修改人脸机会")) {
                            attList.add("80");
                        } else if (gameAttribute1.getFieldName().equals("无修改人脸机会")) {
                            attList.add("81");
                        } else {
                            attList.add("178");
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("王者系列")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF13())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF13());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (gameAttribute.getFieldName().contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("热门武器")) {
                    String pfIds = "";
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF7());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF11());
                    List<GameAttribute> gameAttributs = getGameAttributs(pfIds);
                    if (CollectionUtils.isNotEmpty(gameAttributs)) {
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (gameAttribute.getFieldName().replace("-", "").equals(JSONObject.parseObject(p.toString()).getString("name"))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("角色")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF8())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF8());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (gameAttribute.getFieldName().replace("-", "").equals(JSONObject.parseObject(p.toString()).getString("name"))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("万化皮肤")) {
                    String pfIds = "";
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF7());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF11());
                    List<GameAttribute> gameAttributs = getGameAttributs(pfIds);
                    if (CollectionUtils.isNotEmpty(gameAttributs)) {
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (gameAttribute.getFieldName().replace("-", "").equals(JSONObject.parseObject(p.toString()).getString("name"))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("其他武器")) {
                    String pfIds = "";
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF7());
                    pfIds = reIds(pfIds, goodsInfoAndAttrValueDto.getF11());
                    List<GameAttribute> gameAttributs = getGameAttributs(pfIds);
                    if (CollectionUtils.isNotEmpty(gameAttributs)) {
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (gameAttribute.getFieldName().replace("-", "").equals(JSONObject.parseObject(p.toString()).getString("name"))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (CollectionUtils.isNotEmpty(attList)) {
                    map.put("cat_id", JSONObject.parseObject(o.toString()).getString("cat_id"));
                    map.put("id", attList);
                    attr.add(map);
                }
            }
        } else if (goodsInfoAndAttrValueDto.getGameName().equals("英雄联盟(手游)")) {
            params.put("game_id", 36);
            String response = getAttrs(36, sa);
            String data = JSONObject.parseObject(response).getString("data");
            JSONArray jsonArray = JSONArray.parseArray(data);
            for (Object o : jsonArray) {
                map = new HashMap<>();
                attList = new ArrayList<>();
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("账号类型")) {
                    String regional = goodsInfoAndAttrValueDto.getSystemName() + goodsInfoAndAttrValueDto.getCarrierName();
                    String string = JSONObject.parseObject(o.toString()).getString("attr");
                    JSONArray jsonArray1 = JSONArray.parseArray(string);
                    for (Object p : jsonArray1) {
                        if (JSONObject.parseObject(p.toString()).getString("name").equals(regional)) {
                            attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            break;
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("商品类型")) {
                    attList.add("1");
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("典藏皮肤")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF10())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF10());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (gameAttribute.getFieldName().replace("：孤拳", "瑟提")
                                        .replace("：虹影", "劫").replace("：裁决", "德莱厄斯")
                                        .replace("：征服", "莎弥拉")
                                        .contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("实名情况")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF4())) {
                        GameAttribute gameAttribute1 = gameAttributeMapper.selectGameAttributeById(Long.valueOf(goodsInfoAndAttrValueDto.getF4()));
                        if (gameAttribute1.getFieldName().contains("可二次实名")) {
                            attList.add("7");
                        } else if (gameAttribute1.getFieldName().equals("不可二次实名")) {
                            attList.add("8");
                        } else {
                            attList.add("9");
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("神话皮肤")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF9())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF9());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (gameAttribute.getFieldName().replace("女警", "凯特琳")
                                        .replace("海克斯皇子", "海克斯科技嘉文四世").replace("海克斯牛头", "海克斯科技阿利斯塔")
                                        .replace("海克斯炸弹人", "海克斯科技吉格斯").replace("海克斯安妮", "海克斯科技安妮")
                                        .contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("传说皮肤")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF2())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF2());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (gameAttribute.getFieldName().replace(" ", "").contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("史诗皮肤")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF1())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF1());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (gameAttribute.getFieldName().contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("其他皮肤")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF8())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF8());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (gameAttribute.getFieldName().contains(JSONObject.parseObject(p.toString()).getString("name"))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (CollectionUtils.isNotEmpty(attList)) {
                    map.put("cat_id", JSONObject.parseObject(o.toString()).getString("cat_id"));
                    map.put("id", attList);
                    attr.add(map);
                }
            }
        } else if (goodsInfoAndAttrValueDto.getGameName().equals("永劫无间")) {
            params.put("game_id", 23);
            String response = getAttrs(23, sa);
            String data = JSONObject.parseObject(response).getString("data");
            JSONArray jsonArray = JSONArray.parseArray(data);
            for (Object o : jsonArray) {
                map = new HashMap<>();
                attList = new ArrayList<>();
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("按系统")) {
                    String regional = goodsInfoAndAttrValueDto.getGroupName();
                    String string = JSONObject.parseObject(o.toString()).getString("attr");
                    JSONArray jsonArray1 = JSONArray.parseArray(string);
                    for (Object p : jsonArray1) {
                        if (JSONObject.parseObject(p.toString()).getString("name").contains(regional)) {
                            attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                            break;
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("角色皮肤")) {
                    String child = JSONObject.parseObject(o.toString()).getString("_child");
                    JSONArray jsonArray2 = JSONArray.parseArray(child);
                    for (Object p : jsonArray2) {
                        map = new HashMap<>();
                        attList = new ArrayList<>();
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("宁红夜")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF4())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF4());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("特木尔")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF5())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF5());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("迦南")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF6())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF6());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("季沧海")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF7())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF7());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("胡桃")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF8())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF8());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("天海")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF9())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF9());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("妖刀姬")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF10())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF10());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("崔三娘")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF11())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF11());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("岳山")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF12())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF12());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("无尘")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF13())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF13());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("顾清寒")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF14())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF14());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("武田信忠")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF16())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF16());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("殷紫萍")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF17())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF17());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("沈妙")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF18())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF18());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("胡为")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF19())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF19());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("季莹莹")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF20())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF20());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("玉玲珑")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF15())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF15());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("哈迪")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF21())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF21());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("魏轻")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF22())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF22());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (CollectionUtils.isNotEmpty(attList)) {
                            map.put("cat_id", JSONObject.parseObject(p.toString()).getString("cat_id"));
                            map.put("id", attList);
                            attr.add(map);
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("兵器")) {
                    String child = JSONObject.parseObject(o.toString()).getString("_child");
                    JSONArray jsonArray2 = JSONArray.parseArray(child);
                    for (Object p : jsonArray2) {
                        map = new HashMap<>();
                        attList = new ArrayList<>();
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("长剑")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF24())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF24());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("弓箭皮肤")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF36())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF36());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("太刀")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF25())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF25());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("阔刀")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF26())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF26());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("长枪")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF28())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF28());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("匕首")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF30())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF30());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("万刃轮")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF37())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF37());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("双节棍")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF32())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF32());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("双刀")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF33())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF33());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("棍")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF29())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF29());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("斩马刀")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF27())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF27());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("双戟")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF34())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF34());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("扇")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF31())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF31());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("横刀")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF35())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF35());
                                String attrs = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(attrs);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (JSONObject.parseObject(q.toString()).getString("name").contains(gameAttribute.getFieldName())) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (CollectionUtils.isNotEmpty(attList)) {
                            map.put("cat_id", JSONObject.parseObject(p.toString()).getString("cat_id"));
                            map.put("id", attList);
                            attr.add(map);
                        }
                    }
                }
                if (CollectionUtils.isNotEmpty(attList) && !JSONObject.parseObject(o.toString()).getString("cat_name").equals("角色皮肤")
                        && !JSONObject.parseObject(o.toString()).getString("cat_name").equals("兵器") && !JSONObject.parseObject(o.toString()).getString("cat_name").equals("其他筛选")) {
                    map.put("cat_id", JSONObject.parseObject(o.toString()).getString("cat_id"));
                    map.put("id", attList);
                    attr.add(map);
                }
            }
        } else if (goodsInfoAndAttrValueDto.getGameName().equals("无畏契约")) {
            params.put("game_id", 148);
            String response = getAttrs(148, sa);
            String data = JSONObject.parseObject(response).getString("data");
            JSONArray jsonArray = JSONArray.parseArray(data);
            for (Object o : jsonArray) {
                map = new HashMap<>();
                attList = new ArrayList<>();
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("账号类型")) {
                    if (goodsInfoAndAttrValueDto.getDes().contains("QQ")) {
                        attList.add("4");
                    } else {
                        attList.add("5");
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("实名情况")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF1())) {
                        GameAttribute gameAttribute1 = gameAttributeMapper.selectGameAttributeById(Long.valueOf(goodsInfoAndAttrValueDto.getF1()));
                        if (gameAttribute1.getFieldName().contains("可二次实名")) {
                            attList.add("7");
                        } else if (gameAttribute1.getFieldName().equals("不可二次实名")) {
                            attList.add("6");
                        } else {
                            attList.add("8");
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("近战武器")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF3())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF3());
                        String child = JSONObject.parseObject(o.toString()).getString("_child");
                        JSONArray jsonArray2 = JSONArray.parseArray(child);
                        for (Object p : jsonArray2) {
                            map = new HashMap<>();
                            attList = new ArrayList<>();
                            String string = JSONObject.parseObject(p.toString()).getString("attr");
                            JSONArray jsonArray1 = JSONArray.parseArray(string);
                            for (GameAttribute gameAttribute : gameAttributs) {
                                for (Object q : jsonArray1) {
                                    if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                        attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                    }
                                }
                            }
                            if (CollectionUtils.isNotEmpty(attList)) {
                                map.put("cat_id", JSONObject.parseObject(p.toString()).getString("cat_id"));
                                map.put("id", attList);
                                attr.add(map);
                            }
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("佩枪")) {
                    String child = JSONObject.parseObject(o.toString()).getString("_child");
                    JSONArray jsonArray2 = JSONArray.parseArray(child);
                    for (Object p : jsonArray2) {
                        map = new HashMap<>();
                        attList = new ArrayList<>();
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("标配")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF9())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF9());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("短炮")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF4())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF4());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("狂怒")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF5())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF5());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("鬼魅")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF6())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF6());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("正义")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF7())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF7());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("VCT手枪")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF8())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF8());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (CollectionUtils.isNotEmpty(attList)) {
                            map.put("cat_id", JSONObject.parseObject(p.toString()).getString("cat_id"));
                            map.put("id", attList);
                            attr.add(map);
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("冲锋枪")) {
                    String child = JSONObject.parseObject(o.toString()).getString("_child");
                    JSONArray jsonArray2 = JSONArray.parseArray(child);
                    for (Object p : jsonArray2) {
                        map = new HashMap<>();
                        attList = new ArrayList<>();
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("蜂刺")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF10())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF10());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("骇灵")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF11())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF11());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (CollectionUtils.isNotEmpty(attList)) {
                            map.put("cat_id", JSONObject.parseObject(p.toString()).getString("cat_id"));
                            map.put("id", attList);
                            attr.add(map);
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("霰弹枪")) {
                    String child = JSONObject.parseObject(o.toString()).getString("_child");
                    JSONArray jsonArray2 = JSONArray.parseArray(child);
                    for (Object p : jsonArray2) {
                        map = new HashMap<>();
                        attList = new ArrayList<>();
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("雄鹿")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF12())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF12());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("判官")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF13())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF13());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (CollectionUtils.isNotEmpty(attList)) {
                            map.put("cat_id", JSONObject.parseObject(p.toString()).getString("cat_id"));
                            map.put("id", attList);
                            attr.add(map);
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("步枪")) {
                    String child = JSONObject.parseObject(o.toString()).getString("_child");
                    JSONArray jsonArray2 = JSONArray.parseArray(child);
                    for (Object p : jsonArray2) {
                        map = new HashMap<>();
                        attList = new ArrayList<>();
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("獠犬")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF14())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF14());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("戍卫")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF15())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF15());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("幻影")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF16())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF16());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("狂徒")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF17())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF17());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (CollectionUtils.isNotEmpty(attList)) {
                            map.put("cat_id", JSONObject.parseObject(p.toString()).getString("cat_id"));
                            map.put("id", attList);
                            attr.add(map);
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("狙击枪")) {
                    String child = JSONObject.parseObject(o.toString()).getString("_child");
                    JSONArray jsonArray2 = JSONArray.parseArray(child);
                    for (Object p : jsonArray2) {
                        map = new HashMap<>();
                        attList = new ArrayList<>();
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("飞将")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF20())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF20());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("冥驹")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF18())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF18());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("莽侠")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF19())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF19());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (CollectionUtils.isNotEmpty(attList)) {
                            map.put("cat_id", JSONObject.parseObject(p.toString()).getString("cat_id"));
                            map.put("id", attList);
                            attr.add(map);
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("机枪")) {
                    String child = JSONObject.parseObject(o.toString()).getString("_child");
                    JSONArray jsonArray2 = JSONArray.parseArray(child);
                    for (Object p : jsonArray2) {
                        map = new HashMap<>();
                        attList = new ArrayList<>();
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("战神")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF21())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF21());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (JSONObject.parseObject(p.toString()).getString("cat_name").equals("奥丁")) {
                            if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF22())) {
                                List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF22());
                                String string = JSONObject.parseObject(p.toString()).getString("attr");
                                JSONArray jsonArray1 = JSONArray.parseArray(string);
                                for (GameAttribute gameAttribute : gameAttributs) {
                                    for (Object q : jsonArray1) {
                                        if (gameAttribute.getFieldName().contains(JSONObject.parseObject(q.toString()).getString("name"))) {
                                            attList.add(JSONObject.parseObject(q.toString()).getString("id"));
                                        }
                                    }
                                }
                            }
                        }
                        if (CollectionUtils.isNotEmpty(attList)) {
                            map.put("cat_id", JSONObject.parseObject(p.toString()).getString("cat_id"));
                            map.put("id", attList);
                            attr.add(map);
                        }
                    }
                }
                if (JSONObject.parseObject(o.toString()).getString("cat_name").equals("套装")) {
                    if (StringUtils.isNotEmpty(goodsInfoAndAttrValueDto.getF2())) {
                        List<GameAttribute> gameAttributs = getGameAttributs(goodsInfoAndAttrValueDto.getF2());
                        String string = JSONObject.parseObject(o.toString()).getString("attr");
                        JSONArray jsonArray1 = JSONArray.parseArray(string);
                        for (GameAttribute gameAttribute : gameAttributs) {
                            for (Object p : jsonArray1) {
                                if (gameAttribute.getFieldName().equals(JSONObject.parseObject(p.toString()).getString("name"))) {
                                    attList.add(JSONObject.parseObject(p.toString()).getString("id"));
                                }
                            }
                        }
                    }
                }
                if (CollectionUtils.isNotEmpty(attList)) {
                    String son = JSONObject.parseObject(o.toString()).getString("son");
                    if (son.equals("[]")) {
                        map.put("cat_id", JSONObject.parseObject(o.toString()).getString("cat_id"));
                        map.put("id", attList);
                        attr.add(map);
                    }
                }
            }
        }
        params.put("attr", attr);
        StringBuffer imgs = new StringBuffer();
        String[] split = goodsInfoAndAttrValueDto.getImgUrls().split(",");
        for (String s : split) {
            String imgStr = s;
            imgs.append("<img src=" + JSONObject.toJSONString(imgStr) + ">");
        }
        String content = "<p>" + imgs + "</p>";
        params.put("content", content);
        return params;
    }

    //<p><img src=\"https://images.pxb7.com/images/merchantProduct/20240306/20240306093535_89484.jpg\"><img src=\"https://images.pxb7.com/images/merchantProduct/20240306/20240306093541_84652.jpg\"></p>
    private List<GameAttribute> getGameAttributs(String ids) {
        if (StringUtils.isEmpty(ids)) {
            return new ArrayList<>();
        }
        return gameAttributeMapper.selectGameAttributeListByIds((Long[]) ConvertUtils.convert(ids.split(","),
                Long.class));
    }

    private String reIds(String allIds, String ids) {
        if (StringUtils.isNotEmpty(ids)) {
            if (StringUtils.isNotEmpty(allIds)) {
                allIds = allIds + "," + ids;
            } else {
                allIds = ids;
            }
        }
        return allIds;
    }

    //只保留中文
    private String onlyHanZi(String str) {
        String reg = "[^\u4e00-\u9fa5]";
        str = str.replaceAll(reg, "");
        return str;
    }

}

